package com.example.demo.controller;


import com.example.demo.common.Result;
import com.example.demo.service.UserVideoSubareaService;
import com.example.demo.utils.Util;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletResponse;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author 第五小组
 * @since 2021-08-11
 */
@RestController
@RequestMapping("/bilibili")
public class UserVideoSubareaController {

    @Autowired
    UserVideoSubareaService userVideoSubareaService;

//    视频分区分布统计
    @GetMapping("/uploader/partition_count")
    public Result partition_count(@RequestParam("uid") String uid, HttpServletResponse response){
        Util.exec("\\脚本\\user_video.py ",uid);
        return Result.succ(userVideoSubareaService.listMaps());
    }
}
